home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / mtgdi / mainfrm.cpp next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.1 KB  |  92 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "mtgdi.h"
  15.  
  16. #include "mainfrm.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CMainFrame
  25.  
  26. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  27.  
  28. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  29.     //{{AFX_MSG_MAP(CMainFrame)
  30.     ON_WM_CREATE()
  31.     //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMainFrame construction/destruction
  36.  
  37. CMainFrame::CMainFrame()
  38. {
  39. }
  40.  
  41. CMainFrame::~CMainFrame()
  42. {
  43. }
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CMainFrame diagnostics
  47.  
  48. #ifdef _DEBUG
  49. void CMainFrame::AssertValid() const
  50. {
  51.     CFrameWnd::AssertValid();
  52. }
  53.  
  54. void CMainFrame::Dump(CDumpContext& dc) const
  55. {
  56.     CFrameWnd::Dump(dc);
  57. }
  58.  
  59. #endif //_DEBUG
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CMainFrame message handlers
  63.  
  64. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 
  65. {
  66.     return CFrameWnd::PreCreateWindow(cs);
  67. }
  68.  
  69. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  70. {
  71.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  72.         return -1;
  73.  
  74. #if(_WIN32_WCE > 200)
  75.     if(!m_wndCommandBar.Create(this) ||
  76.        !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) ||
  77.        !m_wndCommandBar.AddAdornments())
  78.     {
  79.         TRACE0("Failed to create CommandBar\n");
  80.         return -1;      // fail to create
  81.     }
  82. #else // MFC for Windows CE 1.0 and 2.0
  83.     if(!AddAdornments(0))
  84.     {
  85.         TRACE0("Failed to create CommandBar\n");
  86.         return -1;      // fail to create
  87.     }
  88. #endif
  89.  
  90.     return 0;
  91. }
  92.